local GameScene = class("GameScene", cc.load("mvc").ViewBase, function (  )
	local scene = cc.Scene:createWithPhysics()
	scene:getPhysicsWorld():setDebugDrawMask(cc.PhysicsWorld.DEBUGDRAM_ALL)
	return scene 
end)

function GameScene:onCreate(  )
	local body = cc.PhysicsBody:createEdgeBox(size,
						cc.PHYSICSBODY_MATERIAL_DEFAULT, 5.0)
	local edgeNode = cc.Note:create()
	edgeNode:setPosition(cc.p(size.width/2, size.height/2))
	edgeNode:setPhysicsBody(body)
	self:addChild(edgeNode)

	local function touchBegan( touch, event )
		local location = touch:getLocation()
		self:addNewSpriteAtPosition(location)
		return false
	end

	local listener = cc.EventListenerTouchOneByOne:create()
	listener:setSwallowTouches(true)
	listener:registerScriptHandler(touchBegan, cc.Handler.EVENT_TOUCH_BEGAN)
	local eventDispatcher = self:getEventDispatcher()

	eventDispatcher:addEventListenerWithSceneGraphPriority(listener, self)
end

return GameScene